function check_user(){
	$.ajax({
	  url: 'GetPlayer',
	  success: function( data ) {
		if(data.slice(0,100).search(document.mainForm.userPlayer.value) != -1) 
		{
			window.clearInterval(id);
			window.location = 'WebIOManager';
		}
                if(data.slice(0,100).search("GAME_FINISHED") != -1)
                 {
			window.clearInterval(id);
			window.location = 'WebIOManager';
                 }

	  }
	});
}

var id = window.setInterval(check_user, 3000);